package com.woniu02;

import java.util.*;

public class Test02 {
    public static void main(String[] args) {
        //list嵌套map
        Student s11 = new Student(1,"zs",11);
        Student s12 = new Student(2,"ls",12);
        Map<Integer,Student> class1 = new HashMap<Integer,Student>();
        class1.put(1,s11);
        class1.put(2,s12);

        Student s21 = new Student(1,"ww",13);
        Student s22 = new Student(2,"zl",14);
        Map<Integer,Student> class2 =new HashMap<>();
        class2.put(1,s21);
        class2.put(2,s22);

        List<Map<Integer,Student>> school = new ArrayList<>();
        school.add(class1);
        school.add(class2);

        for(Map<Integer,Student> myclass : school){
//            for (Map.Entry<Integer,Student> student :myclass.entrySet()){
//                System.out.println(student.getKey());
//                System.out.println(student.getValue());
//            }
            Set<Map.Entry<Integer, Student>> entries = myclass.entrySet();
            for(Map.Entry<Integer, Student> student: entries){
                System.out.println(student.getKey());
                System.out.println(student.getValue());
            }
        }
    }
}
